﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using BP.DA;
using BP.En;
using BP.Sys;
using BP.WF;
using BP.Web;
using BP.Port;
using BP.Demo.BPFramework;
using ThoughtWorks.QRCode.Codec;

namespace CCFlow
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //BP.WF.HttpHandler.WF_Bill
            //string sql = "SELECT * FROM Port_Emp";
            //DataTable dt = DBAccess.RunSQLReturnTable(sql);

            //dt.Columns["NO"].ColumnName = "No";
            //dt.Columns["EMAIL"].ColumnName = "Email";

            //string toJson = BP.Tools.Json.ToJson(dt);
            //this.Response.Write(toJson);
            return;


            MapAttr ma = new MapAttr("ND602_FID");
            ma.Update(MapAttrAttr.GroupID, 1);
            return;


            BP.Port.Emp emp = new Emp();
            emp.No = "zhoupeng";
            emp.Retrieve();
            this.Response.Write(emp.Name);
            return;

            //BP.WF.Template.TemplateGlo.NewFlow("1", "xxx", BP.WF.Template.DataStoreModel.ByCCFlow,null, null, null);
            //return;
            //BP.WF.Flow fl = new Flow();
            //fl.DoNewFlow("1", "xxxx", BP.WF.Template.DataStoreModel.ByCCFlow, null, null);
            //DBAccess.RunSQL("SELECT 1+2");
            //string sql = "@drop table wf_flow";
            //  sql += "@drop table wf_flowsort";
            //  sql += "@drop table port_emp";
            //  sql += "@drop table port_dept";
            //  sql += "@drop table port_deptemp";
            //  sql += "@drop table port_deptempstation";
            //  BP.DA.DBAccess.RunSQLs(sql);


            // BP.DA.DBAccess.RunSQL("drop table wf_flow");

            //BP.WF.DTS.ccbpmServices serv = new BP.WF.DTS.ccbpmServices();
            //serv.Do();


            //  string sqlscript = BP.Sys.SystemConfig.CCFlowAppPath + "\\WF\\Data\\Install\\SQLScript\\InitView_PostgreSQL.sql";
            //  BP.DA.DBAccess.RunSQLScript(sqlscript);
            //  BP.DA.DBAccess.RunSQLReturnVal("SELECT * FROM Port_Dept");
            //  BP.DA.DBAccess.RunSQLReturnTable("SELECT * FROM Port_Dept");
            return;

            //Int64 workid = BP.WF.Dev2Interface.Node_CreateBlankWork("009");
            ////开始保存这个workid 到你的出库单。
            ////执行发送动作, 可以指定到节点，指定到接收人。
            //BP.WF.Dev2Interface.Node_SendWork("009", workid, 0, "zhangsan");
            return;

            //sdsds
            // sds

            BP.WF.Dev2Interface.Port_Login("zhangsan");


            //BP.WF.Dev2Interface.Port_Login("zhangsan", "sss");

            //BP.Port.Emp emp = new Emp("liuyuke");
            return;

            BP.WF.Template.MapFrmFools ens = new BP.WF.Template.MapFrmFools();
            ens.RetrieveAll();
            foreach (BP.WF.Template.MapFrmFool item in ens)
            {
                item.DoCheckFixFrmForUpdateVer();
            }
            return;

            //BP.LI.BZWs
            // BP.DA.DataType.ReadTextFile
            BP.DA.Log.DefaultLogWriteLine(LogType.Info, "----------------------------------  start ------------------ ");
            BP.DA.Log.DefaultLogWriteLine(LogType.Info, "----------------------------------  end ------------------ ");

            if (DBAccess.IsExitsObject("WF_Flow") == false)
                this.Response.Redirect("./WF/Admin/DBInstall.htm", true);
            else
                this.Response.Redirect("./WF/Admin/CCBPMDesigner/Login.htm", true);
            return;
        }
    }
}